﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;


namespace Sistema_de_Taller.SDT_DAL.Utilities
{
    public class AssignedEmployee_DAL
    {
        public void AssignedEmployeeInsert(Common_Files.Definitions.AssignedEmployee AssignedEmployee)
        {
            SqlConnection Connection = Common_Files.Connection.OpenConecction();
            SqlCommand Command = new SqlCommand(@"insert into AssignedEmployee (WorkOrder_ID, AssignedEmployee_Hours, Employee_ID) 
                                                                values ('" + AssignedEmployee.WorkOrderID + "', '" + AssignedEmployee.AssignedEmployee_Hours + "', '" + AssignedEmployee.Employee_ID + "')", Connection);
            Common_Files.Connection.CloseConecction(Connection, Command);
        }

        public DataSet AssignedEmployeerLoadID(UInt32 WorkOrderID)
        {
            SqlConnection Connection = Common_Files.Connection.OpenConecction();
            SqlDataAdapter Command = new SqlDataAdapter(@"Select AssignedEmployee_ID, AssignedEmployee_Hours from AssignedEmployee where WorkOrder_ID = '" + WorkOrderID + "'", Connection);
            DataSet DataSet = new DataSet();
            Command.Fill(DataSet);
            return (DataSet);
        }
    }
}